#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Author:liang futing
#@Time :2019/4/11 14:42

from django.urls import path,re_path
from .views import SystemView
from .views_structure import StructureView,StructureCreateView,StructureListView,StructureDeleteView,Structure2UserView
from .views_user import UserView,UserListView,UserCreateView,UserDetailView,UserUpdateView
from .views_user import PasswordChangeView,UserDeleteView,UserEnableView,UserDisableView
from .views_menu import MenuCreateView,MenuListView,MenuUpdateView
from . import views_role
app_name='system'

urlpatterns=[
    path('',SystemView.as_view(),name='login'),
    path('basic/structure/',StructureView.as_view(),name='basic-structure'),
    path('basic/structure/create/',StructureCreateView.as_view(),name='basic-structure-create'),
    path('basic/structure/list/',StructureListView.as_view(),name='basic-structure-list'),
    path('basic/structure/delete/',StructureDeleteView.as_view(),name='basic-structure-delete'),
    path('basic/structure/add_user/',Structure2UserView.as_view(),name='basic-structure-add_user'),
    path('basic/user/',UserView.as_view(),name='basic-user'),
    #返回的是User json数据接口
    path('basic/user/list/',UserListView.as_view(),name='basic-user-list'),
    path('basic/user/create/',UserCreateView.as_view(),name='basic-user-create'),
    path('basic/user/detail/',UserDetailView.as_view(),name='basic-user-detail'),
    path('basic/user/update/',UserUpdateView.as_view(),name='basic-user-update'),
    path('basic/user/password_change/',PasswordChangeView.as_view(),name='basic-user-password_change'),
    path('basic/user/delete/',UserDeleteView.as_view(),name='basic-user-delete'),
    path('basic/user/enable/',UserEnableView.as_view(),name='basic-user-enable'),
    path('basic/user/disable/',UserDisableView.as_view(),name='basic-user-disable'),

    # rbac
    path('rbac/menu/create/',MenuCreateView.as_view(),name='rbac-menu-create'),
    path('rbac/menu/',MenuListView.as_view(),name='rbac-menu'),
    path('rbac/menu/update/',MenuUpdateView.as_view(),name='rbac-menu-update'),

    #role
    path('rbac/role/',views_role.RoleView.as_view(),name='rbac-role'),
    path('rbac/role/create/',views_role.RoleCreateView.as_view(),name='rbac-role-create'),
    path('rbac/role/list/',views_role.RoleListView.as_view(),name='rbac-role-list'),
    path('rbac/role/update/',views_role.RoleUpdateView.as_view(),name='rbac-role-update'),
    path('rbac/role/delete/',views_role.RoleDeleteView.as_view(),name='rbac-role-delete'),
    path('rbac/role/role2user/',views_role.Role2UserView.as_view(),name='rbac-role-role2user'),
    path('rbac/role/role2menu/',views_role.Role2MenuView.as_view(),name='rbac-role-role2menu'),
    path('rbac/role/role2menu_list/',views_role.Role2MenuListView.as_view(),name='rbac-role-role2menu_list'),
]